<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //原型链:
      //基本原型链,初级原型链
      //只有函数有prototype
      //   __proto__是对象独有的

      function Person(name) {
        //构造函数
        this.name = name;
      }
      console.log(Person);
      console.log(typeof Person.prototype);
      console.log(Person.prototype);
      console.log(Person.prototype.constructor);
      console.log(Person.prototype.constructor === Person);

      var zhangsan = new Person("张三");
      console.log("实例化对象", zhangsan);
      var lisi = new Person("李四");
      //   [[Prototype]]等同于__proto__
      console.log(zhangsan.__proto__);
      console.log(zhangsan.__proto__ === lisi.__proto__);
      console.log(zhangsan.__proto__ === Person.prototype);

      console.log(Object.prototype);
    </script>
  </body>
</html>
